<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var names =['aaa','bbb','ccc','ddd','eeee'];
        names.pop();
        document.write(names);
        document.write("<br>");

        names.push('tttt');
        document.write(names);
        document.write("<br>");

        var names =['aaa','bbb','ccc','ddd','eeee'];
        names.splice(2,1);//从2个位置删除1个元素
        document.write(names);
        document.write("<br>");

        var names =['aaa','bbb','ccc','ddd','eeee'];
        names.splice(2,1,'11','222','333');//从2个位置删除1个元素,并添加3个新元素
        document.write(names);
        document.write("<br>");

    </script>
</head>
<body>
    
</body>
</html>